/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.validator;

import com.minierp.model.Accessory;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

public class AccessoryValidator implements Validator {
	public boolean supports(Class clazz) {
		return Accessory.class.isAssignableFrom(clazz);
	}

	public void validate(Object obj, Errors errors) {
		Accessory form = (Accessory) obj;
		if (form.getMark() != null && form.getMark().length() > 50) {
			errors.rejectValue("mark", "", "『文件』说明不能超过50个字");
		}

	}
}